.class Lorg/jboss/netty/channel/socket/oio/OioWorker;
.super Ljava/lang/Object;
.source "OioWorker.java"

# interfaces
.implements Ljava/lang/Runnable;


# static fields
.field private static final SOCKET_CLOSED_MESSAGE:Ljava/util/regex/Pattern;


# instance fields
.field private final channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    .line 36
    const-string v0, "^.*(?:Socket.*closed).*$"

    const/4 v1, 0x2

    invoke-static {v0, v1}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;I)Ljava/util/regex/Pattern;

    move-result-object v0

    sput-object v0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->SOCKET_CLOSED_MESSAGE:Ljava/util/regex/Pattern;

    return-void
.end method

.method constructor <init>(Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;)V
    .locals 0
    .parameter "channel"

    .prologue
    .line 41
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 42
    iput-object p1, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    .line 43
    return-void
.end method

.method static close(Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;Lorg/jboss/netty/channel/ChannelFuture;)V
    .locals 6
    .parameter "channel"
    .parameter "future"

    .prologue
    .line 208
    invoke-virtual {p0}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->isConnected()Z

    move-result v1

    .line 209
    .local v1, connected:Z
    invoke-virtual {p0}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->isBound()Z

    move-result v0

    .line 211
    .local v0, bound:Z
    :try_start_0
    iget-object v5, p0, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->socket:Ljava/net/Socket;

    invoke-virtual {v5}, Ljava/net/Socket;->close()V

    .line 212
    invoke-virtual {p0}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->setClosed()Z

    move-result v5

    if-eqz v5, :cond_3

    .line 213
    invoke-interface {p1}, Lorg/jboss/netty/channel/ChannelFuture;->setSuccess()Z

    .line 214
    if-eqz v1, :cond_1

    .line 216
    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v2

    .line 217
    .local v2, currentThread:Ljava/lang/Thread;
    iget-object v4, p0, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->workerThread:Ljava/lang/Thread;

    .line 218
    .local v4, workerThread:Ljava/lang/Thread;
    if-eqz v4, :cond_0

    if-eq v2, v4, :cond_0

    .line 219
    invoke-virtual {v4}, Ljava/lang/Thread;->interrupt()V

    .line 221
    :cond_0
    invoke-static {p0}, Lorg/jboss/netty/channel/Channels;->fireChannelDisconnected(Lorg/jboss/netty/channel/Channel;)V

    .line 223
    .end local v2           #currentThread:Ljava/lang/Thread;
    .end local v4           #workerThread:Ljava/lang/Thread;
    :cond_1
    if-eqz v0, :cond_2

    .line 224
    invoke-static {p0}, Lorg/jboss/netty/channel/Channels;->fireChannelUnbound(Lorg/jboss/netty/channel/Channel;)V

    .line 226
    :cond_2
    invoke-static {p0}, Lorg/jboss/netty/channel/Channels;->fireChannelClosed(Lorg/jboss/netty/channel/Channel;)V

    .line 234
    :goto_0
    return-void

    .line 228
    :cond_3
    invoke-interface {p1}, Lorg/jboss/netty/channel/ChannelFuture;->setSuccess()Z
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 230
    :catch_0
    move-exception v3

    .line 231
    .local v3, t:Ljava/lang/Throwable;
    invoke-interface {p1, v3}, Lorg/jboss/netty/channel/ChannelFuture;->setFailure(Ljava/lang/Throwable;)Z

    .line 232
    invoke-static {p0, v3}, Lorg/jboss/netty/channel/Channels;->fireExceptionCaught(Lorg/jboss/netty/channel/Channel;Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method static setInterestOps(Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;Lorg/jboss/netty/channel/ChannelFuture;I)V
    .locals 6
    .parameter "channel"
    .parameter "future"
    .parameter "interestOps"

    .prologue
    .line 172
    and-int/lit8 p2, p2, -0x5

    .line 173
    invoke-virtual {p0}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->getInterestOps()I

    move-result v4

    and-int/lit8 v4, v4, 0x4

    or-int/2addr p2, v4

    .line 175
    const/4 v0, 0x0

    .line 177
    .local v0, changed:Z
    :try_start_0
    invoke-virtual {p0}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->getInterestOps()I

    move-result v4

    if-eq v4, p2, :cond_0

    .line 178
    and-int/lit8 v4, p2, 0x1

    if-eqz v4, :cond_3

    .line 179
    const/4 v4, 0x1

    invoke-virtual {p0, v4}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->setInterestOpsNow(I)V

    .line 183
    :goto_0
    const/4 v0, 0x1

    .line 186
    :cond_0
    invoke-interface {p1}, Lorg/jboss/netty/channel/ChannelFuture;->setSuccess()Z

    .line 187
    if-eqz v0, :cond_2

    .line 188
    iget-object v5, p0, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->interestOpsLock:Ljava/lang/Object;

    monitor-enter v5
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    .line 189
    :try_start_1
    invoke-virtual {p0, p2}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->setInterestOpsNow(I)V

    .line 192
    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v1

    .line 193
    .local v1, currentThread:Ljava/lang/Thread;
    iget-object v3, p0, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->workerThread:Ljava/lang/Thread;

    .line 194
    .local v3, workerThread:Ljava/lang/Thread;
    if-eqz v3, :cond_1

    if-eq v1, v3, :cond_1

    .line 195
    invoke-virtual {v3}, Ljava/lang/Thread;->interrupt()V

    .line 197
    :cond_1
    monitor-exit v5
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 199
    :try_start_2
    invoke-static {p0}, Lorg/jboss/netty/channel/Channels;->fireChannelInterestChanged(Lorg/jboss/netty/channel/Channel;)V

    .line 205
    .end local v1           #currentThread:Ljava/lang/Thread;
    .end local v3           #workerThread:Ljava/lang/Thread;
    :cond_2
    :goto_1
    return-void

    .line 181
    :cond_3
    const/4 v4, 0x0

    invoke-virtual {p0, v4}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->setInterestOpsNow(I)V
    :try_end_2
    .catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_0

    .line 201
    :catch_0
    move-exception v2

    .line 202
    .local v2, t:Ljava/lang/Throwable;
    invoke-interface {p1, v2}, Lorg/jboss/netty/channel/ChannelFuture;->setFailure(Ljava/lang/Throwable;)Z

    .line 203
    invoke-static {p0, v2}, Lorg/jboss/netty/channel/Channels;->fireExceptionCaught(Lorg/jboss/netty/channel/Channel;Ljava/lang/Throwable;)V

    goto :goto_1

    .line 197
    .end local v2           #t:Ljava/lang/Throwable;
    :catchall_0
    move-exception v4

    :try_start_3
    monitor-exit v5
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    :try_start_4
    throw v4
    :try_end_4
    .catch Ljava/lang/Throwable; {:try_start_4 .. :try_end_4} :catch_0
.end method

.method static write(Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;Lorg/jboss/netty/channel/ChannelFuture;Ljava/lang/Object;)V
    .locals 14
    .parameter "channel"
    .parameter "future"
    .parameter "message"

    .prologue
    .line 109
    invoke-virtual {p0}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->getOutputStream()Ljava/io/OutputStream;

    move-result-object v8

    .line 110
    .local v8, out:Ljava/io/OutputStream;
    if-nez v8, :cond_0

    .line 111
    new-instance v3, Ljava/nio/channels/ClosedChannelException;

    invoke-direct {v3}, Ljava/nio/channels/ClosedChannelException;-><init>()V

    .line 112
    .local v3, e:Ljava/lang/Exception;
    invoke-interface {p1, v3}, Lorg/jboss/netty/channel/ChannelFuture;->setFailure(Ljava/lang/Throwable;)Z

    .line 113
    invoke-static {p0, v3}, Lorg/jboss/netty/channel/Channels;->fireExceptionCaught(Lorg/jboss/netty/channel/Channel;Ljava/lang/Throwable;)V

    .line 166
    .end local v3           #e:Ljava/lang/Exception;
    :goto_0
    return-void

    .line 118
    :cond_0
    const/4 v7, 0x0

    .line 122
    .local v7, length:I
    :try_start_0
    move-object/from16 v0, p2

    instance-of v10, v0, Lorg/jboss/netty/channel/FileRegion;

    if-eqz v10, :cond_6

    .line 123
    move-object/from16 v0, p2

    check-cast v0, Lorg/jboss/netty/channel/FileRegion;

    move-object v4, v0
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    .line 125
    .local v4, fr:Lorg/jboss/netty/channel/FileRegion;
    :try_start_1
    monitor-enter v8
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1

    .line 126
    :try_start_2
    invoke-static {v8}, Ljava/nio/channels/Channels;->newChannel(Ljava/io/OutputStream;)Ljava/nio/channels/WritableByteChannel;

    move-result-object v2

    .line 128
    .local v2, bchannel:Ljava/nio/channels/WritableByteChannel;
    const-wide/16 v5, 0x0

    .line 129
    .local v5, i:J
    :cond_1
    int-to-long v10, v7

    invoke-interface {v4, v2, v10, v11}, Lorg/jboss/netty/channel/FileRegion;->transferTo(Ljava/nio/channels/WritableByteChannel;J)J

    move-result-wide v5

    const-wide/16 v10, 0x0

    cmp-long v10, v5, v10

    if-lez v10, :cond_2

    .line 130
    int-to-long v10, v7

    add-long/2addr v10, v5

    long-to-int v7, v10

    .line 131
    int-to-long v10, v7

    invoke-interface {v4}, Lorg/jboss/netty/channel/FileRegion;->getCount()J

    move-result-wide v12

    cmp-long v10, v10, v12

    if-ltz v10, :cond_1

    .line 135
    :cond_2
    monitor-exit v8
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 137
    :try_start_3
    instance-of v10, v4, Lorg/jboss/netty/channel/DefaultFileRegion;

    if-eqz v10, :cond_3

    .line 138
    move-object v0, v4

    check-cast v0, Lorg/jboss/netty/channel/DefaultFileRegion;

    move-object v10, v0

    invoke-virtual {v10}, Lorg/jboss/netty/channel/DefaultFileRegion;->releaseAfterTransfer()Z

    move-result v10

    if-eqz v10, :cond_3

    .line 139
    invoke-interface {v4}, Lorg/jboss/netty/channel/FileRegion;->releaseExternalResources()V

    .line 152
    .end local v2           #bchannel:Ljava/nio/channels/WritableByteChannel;
    .end local v4           #fr:Lorg/jboss/netty/channel/FileRegion;
    .end local v5           #i:J
    :cond_3
    :goto_1
    int-to-long v10, v7

    invoke-static {p0, v10, v11}, Lorg/jboss/netty/channel/Channels;->fireWriteComplete(Lorg/jboss/netty/channel/Channel;J)V

    .line 153
    invoke-interface {p1}, Lorg/jboss/netty/channel/ChannelFuture;->setSuccess()Z
    :try_end_3
    .catch Ljava/lang/Throwable; {:try_start_3 .. :try_end_3} :catch_0

    goto :goto_0

    .line 155
    :catch_0
    move-exception v9

    .line 158
    .local v9, t:Ljava/lang/Throwable;
    instance-of v10, v9, Ljava/net/SocketException;

    if-eqz v10, :cond_4

    sget-object v10, Lorg/jboss/netty/channel/socket/oio/OioWorker;->SOCKET_CLOSED_MESSAGE:Ljava/util/regex/Pattern;

    invoke-virtual {v9}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;

    move-result-object v11

    invoke-static {v11}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v10

    invoke-virtual {v10}, Ljava/util/regex/Matcher;->matches()Z

    move-result v10

    if-eqz v10, :cond_4

    .line 161
    new-instance v9, Ljava/nio/channels/ClosedChannelException;

    .end local v9           #t:Ljava/lang/Throwable;
    invoke-direct {v9}, Ljava/nio/channels/ClosedChannelException;-><init>()V

    .line 163
    .restart local v9       #t:Ljava/lang/Throwable;
    :cond_4
    invoke-interface {p1, v9}, Lorg/jboss/netty/channel/ChannelFuture;->setFailure(Ljava/lang/Throwable;)Z

    .line 164
    invoke-static {p0, v9}, Lorg/jboss/netty/channel/Channels;->fireExceptionCaught(Lorg/jboss/netty/channel/Channel;Ljava/lang/Throwable;)V

    goto :goto_0

    .line 135
    .end local v9           #t:Ljava/lang/Throwable;
    .restart local v4       #fr:Lorg/jboss/netty/channel/FileRegion;
    :catchall_0
    move-exception v10

    :try_start_4
    monitor-exit v8
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    :try_start_5
    throw v10
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_1

    .line 137
    :catchall_1
    move-exception v10

    move-object v11, v10

    :try_start_6
    instance-of v10, v4, Lorg/jboss/netty/channel/DefaultFileRegion;

    if-eqz v10, :cond_5

    .line 138
    move-object v0, v4

    check-cast v0, Lorg/jboss/netty/channel/DefaultFileRegion;

    move-object v10, v0

    invoke-virtual {v10}, Lorg/jboss/netty/channel/DefaultFileRegion;->releaseAfterTransfer()Z

    move-result v10

    if-eqz v10, :cond_5

    .line 139
    invoke-interface {v4}, Lorg/jboss/netty/channel/FileRegion;->releaseExternalResources()V

    :cond_5
    throw v11

    .line 145
    .end local v4           #fr:Lorg/jboss/netty/channel/FileRegion;
    :cond_6
    move-object/from16 v0, p2

    check-cast v0, Lorg/jboss/netty/buffer/ChannelBuffer;

    move-object v1, v0

    .line 146
    .local v1, a:Lorg/jboss/netty/buffer/ChannelBuffer;
    invoke-interface {v1}, Lorg/jboss/netty/buffer/ChannelBuffer;->readableBytes()I

    move-result v7

    .line 147
    monitor-enter v8
    :try_end_6
    .catch Ljava/lang/Throwable; {:try_start_6 .. :try_end_6} :catch_0

    .line 148
    :try_start_7
    invoke-interface {v1}, Lorg/jboss/netty/buffer/ChannelBuffer;->readerIndex()I

    move-result v10

    invoke-interface {v1, v10, v8, v7}, Lorg/jboss/netty/buffer/ChannelBuffer;->getBytes(ILjava/io/OutputStream;I)V

    .line 149
    monitor-exit v8

    goto :goto_1

    :catchall_2
    move-exception v10

    monitor-exit v8
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_2

    :try_start_8
    throw v10
    :try_end_8
    .catch Ljava/lang/Throwable; {:try_start_8 .. :try_end_8} :catch_0
.end method


# virtual methods
.method public run()V
    .locals 11

    .prologue
    .line 46
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v9

    iput-object v9, v8, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->workerThread:Ljava/lang/Thread;

    .line 47
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    invoke-virtual {v8}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->getInputStream()Ljava/io/PushbackInputStream;

    move-result-object v5

    .line 49
    .local v5, in:Ljava/io/PushbackInputStream;
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    instance-of v4, v8, Lorg/jboss/netty/channel/socket/oio/OioAcceptedSocketChannel;

    .line 51
    .local v4, fireConnected:Z
    :goto_0
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    invoke-virtual {v8}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->isOpen()Z

    move-result v8

    if-eqz v8, :cond_4

    .line 52
    if-eqz v4, :cond_0

    .line 53
    const/4 v4, 0x0

    .line 54
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    iget-object v9, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    invoke-virtual {v9}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->getRemoteAddress()Ljava/net/InetSocketAddress;

    move-result-object v9

    invoke-static {v8, v9}, Lorg/jboss/netty/channel/Channels;->fireChannelConnected(Lorg/jboss/netty/channel/Channel;Ljava/net/SocketAddress;)V

    .line 56
    :cond_0
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    iget-object v9, v8, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->interestOpsLock:Ljava/lang/Object;

    monitor-enter v9

    .line 57
    :cond_1
    :goto_1
    :try_start_0
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    invoke-virtual {v8}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->isReadable()Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v8

    if-nez v8, :cond_2

    .line 61
    :try_start_1
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    iget-object v8, v8, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->interestOpsLock:Ljava/lang/Object;

    invoke-virtual {v8}, Ljava/lang/Object;->wait()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1

    .line 62
    :catch_0
    move-exception v3

    .line 63
    .local v3, e:Ljava/lang/InterruptedException;
    :try_start_2
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    invoke-virtual {v8}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->isOpen()Z

    move-result v8

    if-nez v8, :cond_1

    .line 68
    .end local v3           #e:Ljava/lang/InterruptedException;
    :cond_2
    monitor-exit v9
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 73
    :try_start_3
    invoke-virtual {v5}, Ljava/io/PushbackInputStream;->available()I

    move-result v2

    .line 74
    .local v2, bytesToRead:I
    if-lez v2, :cond_3

    .line 75
    new-array v1, v2, [B

    .line 76
    .local v1, buf:[B
    invoke-virtual {v5, v1}, Ljava/io/PushbackInputStream;->read([B)I
    :try_end_3
    .catch Ljava/lang/Throwable; {:try_start_3 .. :try_end_3} :catch_1

    move-result v6

    .line 92
    .local v6, readBytes:I
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    iget-object v9, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    invoke-virtual {v9}, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->getConfig()Lorg/jboss/netty/channel/socket/SocketChannelConfig;

    move-result-object v9

    invoke-interface {v9}, Lorg/jboss/netty/channel/socket/SocketChannelConfig;->getBufferFactory()Lorg/jboss/netty/buffer/ChannelBufferFactory;

    move-result-object v9

    const/4 v10, 0x0

    invoke-interface {v9, v1, v10, v6}, Lorg/jboss/netty/buffer/ChannelBufferFactory;->getBuffer([BII)Lorg/jboss/netty/buffer/ChannelBuffer;

    move-result-object v9

    invoke-static {v8, v9}, Lorg/jboss/netty/channel/Channels;->fireMessageReceived(Lorg/jboss/netty/channel/Channel;Ljava/lang/Object;)V

    goto :goto_0

    .line 68
    .end local v1           #buf:[B
    .end local v2           #bytesToRead:I
    .end local v6           #readBytes:I
    :catchall_0
    move-exception v8

    :try_start_4
    monitor-exit v9
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    throw v8

    .line 78
    .restart local v2       #bytesToRead:I
    :cond_3
    :try_start_5
    invoke-virtual {v5}, Ljava/io/PushbackInputStream;->read()I
    :try_end_5
    .catch Ljava/lang/Throwable; {:try_start_5 .. :try_end_5} :catch_1

    move-result v0

    .line 79
    .local v0, b:I
    if-gez v0, :cond_5

    .line 99
    .end local v0           #b:I
    .end local v2           #bytesToRead:I
    :cond_4
    :goto_2
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    const/4 v9, 0x0

    iput-object v9, v8, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->workerThread:Ljava/lang/Thread;

    .line 102
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    iget-object v9, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    invoke-static {v9}, Lorg/jboss/netty/channel/Channels;->succeededFuture(Lorg/jboss/netty/channel/Channel;)Lorg/jboss/netty/channel/ChannelFuture;

    move-result-object v9

    invoke-static {v8, v9}, Lorg/jboss/netty/channel/socket/oio/OioWorker;->close(Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;Lorg/jboss/netty/channel/ChannelFuture;)V

    .line 103
    return-void

    .line 82
    .restart local v0       #b:I
    .restart local v2       #bytesToRead:I
    :cond_5
    :try_start_6
    invoke-virtual {v5, v0}, Ljava/io/PushbackInputStream;->unread(I)V
    :try_end_6
    .catch Ljava/lang/Throwable; {:try_start_6 .. :try_end_6} :catch_1

    goto :goto_0

    .line 85
    .end local v0           #b:I
    .end local v2           #bytesToRead:I
    :catch_1
    move-exception v7

    .line 86
    .local v7, t:Ljava/lang/Throwable;
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    iget-object v8, v8, Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;->socket:Ljava/net/Socket;

    invoke-virtual {v8}, Ljava/net/Socket;->isClosed()Z

    move-result v8

    if-nez v8, :cond_4

    .line 87
    iget-object v8, p0, Lorg/jboss/netty/channel/socket/oio/OioWorker;->channel:Lorg/jboss/netty/channel/socket/oio/OioSocketChannel;

    invoke-static {v8, v7}, Lorg/jboss/netty/channel/Channels;->fireExceptionCaught(Lorg/jboss/netty/channel/Channel;Ljava/lang/Throwable;)V

    goto :goto_2
.end method
